﻿//调整率
Chenxin.UI.Relative = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListBargain.ashx',
    id: 'jqRelative',
    renderTo: 'div_Relative',
    winCls: '',
    jqmWidth: 600,
    defBBtn: true,
    scope: this,
    op: 'relative',
    createForm: function() {
        return Chenxin.FormCommon.Relative(this.id);
    },
    createGrid: function() {
        _this = this;
        return new Chenxin.UI.JsonGrid({
            actionUrl: this.actionUrl + '?op=getrelative',
            id: 'history_able',
            renderTo: 'historyable',
            hasCheckBox: false,
            height: 170,
            cellBorder: true,
            modelId: 'ContractId',
            autoLoad: false,
            scope: this,
            columns: {
                ContractCode: {
                    head: '成交编号',
                    width: 120
                },
                HouseAddress: {
                    head: '房源地址',
                    width: 200
                },
                DiscountRate: {
                    head: '调整率',
                    width: 60
                },
                Addtime: {
                    head: '调整时间',
                    width: 80,
                    renderer: function(val, field, row) {
                        return val.split(' ')[0];
                    }
                },
                AddPerson: {
                    head: '操作人',
                    width: 80
                }
            }
        });
    },
    initEvent: function() {
        var _this = this;
        $("#but1").live("click", function() {
            $("#div2").show();
            $("#div1").hide();            
        });
        $("#but2").live("click", function() {
            $("#div1").show();
            $("#div2").hide();
        });
        $('#DiscountRate').numberText({
            minValue: 0,
            maxValue:1
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.Relative.superclass.initComponent.call(this);
        this.grid = this.createGrid();
    }
});

Chenxin.FormCommon.Relative = function(formID) {
return '<div id="div1" style="width:100%;"><table style="width:100%;margin:5px 0px;"><tr style="line-height: 26px;"><td style="width:120px;text-align:right;margin:5px;">成交编号：</td><td><input style=";" name="ContractCode" class="inputbox_n fl" id="ContractCode" type="text" readonly="readonly" /></tr><tr style="line-height: 26px;"><td style="text-align:right;">成交日期：</td><td><input style=";" name="ContractDate" class="inputbox_n fl" id="ContractDate" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">业绩归属：</td><td><input style=";" name="ArchivementDate" class="inputbox_n fl" id="ArchivementDate" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">房源地址：</td><td><input style="width:250px;" name="HouseAddress" class="inputbox_n fl" id="HouseAddress" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td  style="text-align:right;">上家姓名：</td><td><input style=";" name="VenderName" class="inputbox_n fl" id="VenderName" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">上家确认佣收：</td><td><input style=";" name="VRealCommision" class="inputbox_n fl" id="VRealCommision" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">下家姓名：</td><td><input style=";" name="BuyerName" class="inputbox_n fl" id="VenderName" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">下家确认佣收：</td><td><input style=";" name="BRealCommision" class="inputbox_n fl" id="VRealCommision" type="text" readonly="readonly" /></td></tr><tr style="line-height: 26px;"><td style="text-align:right;">调整率：</td><td><input style=";" name="DiscountRate" class="inputbox_n fl" id="DiscountRate" type="text" /><span style="color:red;margin:5px;">如不做调整，则输入1。</span></td><td></td><td></td></tr></table><div class="btn btn2"><a href="javascript:void(0)" title="查看历史" id="but1"><span>查看历史</span></a></div></div><div id="div2" style="display:none;"><div id="historyable" style="width:100%;"></div><div class="btn btn2"><a href="javascript:void(0)" title="查看调整" id="but2"><span>查看调整</span></a></div></div>';
};